﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.project.entity;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.project.dao.*;
import com.hh.bss.project.entity.*;
import com.hh.bss.project.service.*;
import com.hh.bss.project.vo.query.*;
import com.hh.bss.util.*;





public class AccountInvoice extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "AccountInvoice";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_PN_NBR = "pnNbr";
	public static final String ALIAS_NBR = "nbr";
	public static final String ALIAS_AMOUNT = "amount";
	public static final String ALIAS_CURRENCY = "currency";
	public static final String ALIAS_STATUS = "status";
	public static final String ALIAS_SEND_DT = "sendDt";
	public static final String ALIAS_SENDER = "sender";
	public static final String ALIAS_RECIEVER = "reciever";
	public static final String ALIAS_EXPRESS_ID = "expressId";
	public static final String ALIAS_RECIEVE_DT = "recieveDt";
	public static final String ALIAS_COMMENT = "comment";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	
	//date formats
	public static final String FORMAT_SEND_DT = DATE_FORMAT;
	public static final String FORMAT_RECIEVE_DT = DATE_FORMAT;
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotBlank @Length(max=50)
	private java.lang.String pnNbr;
	@NotNull 
	private java.lang.String nbr;
	@NotNull 
	private java.lang.Double amount;
	@NotBlank @Length(max=3)
	private java.lang.String currency;
	@NotNull @Max(32767)
	private Integer status;
	
	private java.util.Date sendDt;
	@Length(max=20)
	private java.lang.String sender;
	
	private java.lang.Integer reciever;
	@Length(max=50)
	private java.lang.String expressId;
	
	private java.util.Date recieveDt;
	@Length(max=255)
	private java.lang.String comment;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	//columns END

	public AccountInvoice(){
	}

	public AccountInvoice(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setPnNbr(java.lang.String value) {
		this.pnNbr = value;
	}
	
	public java.lang.String getPnNbr() {
		return this.pnNbr;
	}
	
	public java.lang.String getNbr() {
		return nbr;
	}

	public void setNbr(java.lang.String nbr) {
		this.nbr = nbr;
	}

	public void setAmount(java.lang.Double value) {
		this.amount = value;
	}
	
	public java.lang.Double getAmount() {
		return this.amount;
	}
	public void setCurrency(java.lang.String value) {
		this.currency = value;
	}
	
	public java.lang.String getCurrency() {
		return this.currency;
	}
	public void setStatus(Integer value) {
		this.status = value;
	}
	
	public Integer getStatus() {
		return this.status;
	}
	public String getSendDtString() {
		return DateConvertUtils.format(getSendDt(), FORMAT_SEND_DT);
	}
	public void setSendDtString(String value) {
		setSendDt(DateConvertUtils.parse(value, FORMAT_SEND_DT,java.util.Date.class));
	}
	
	public void setSendDt(java.util.Date value) {
		this.sendDt = value;
	}
	
	public java.util.Date getSendDt() {
		return this.sendDt;
	}
	public void setSender(java.lang.String value) {
		this.sender = value;
	}
	
	public java.lang.String getSender() {
		return this.sender;
	}
	public void setReciever(java.lang.Integer value) {
		this.reciever = value;
	}
	
	public java.lang.Integer getReciever() {
		return this.reciever;
	}
	public void setExpressId(java.lang.String value) {
		this.expressId = value;
	}
	
	public java.lang.String getExpressId() {
		return this.expressId;
	}
	public String getRecieveDtString() {
		return DateConvertUtils.format(getRecieveDt(), FORMAT_RECIEVE_DT);
	}
	public void setRecieveDtString(String value) {
		setRecieveDt(DateConvertUtils.parse(value, FORMAT_RECIEVE_DT,java.util.Date.class));
	}
	
	public void setRecieveDt(java.util.Date value) {
		this.recieveDt = value;
	}
	
	public java.util.Date getRecieveDt() {
		return this.recieveDt;
	}
	public void setComment(java.lang.String value) {
		this.comment = value;
	}
	
	public java.lang.String getComment() {
		return this.comment;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("PnNbr",getPnNbr())
			.append("Nbr",getNbr())
			.append("Amount",getAmount())
			.append("Currency",getCurrency())
			.append("Status",getStatus())
			.append("SendDt",getSendDt())
			.append("Sender",getSender())
			.append("Reciever",getReciever())
			.append("ExpressId",getExpressId())
			.append("RecieveDt",getRecieveDt())
			.append("Comment",getComment())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof AccountInvoice == false) return false;
		if(this == obj) return true;
		AccountInvoice other = (AccountInvoice)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

